<template>
  <a-config-provider :locale="locale">
    <div id="app">
      <router-view />
      <audio controls :src="src" id="AUDIO"></audio>
    </div>
  </a-config-provider>
</template>

<script>
import { setDocumentTitle } from '@/utils/domUtil'
import { i18nRender } from '@/locales'
import storage from 'store'

export default {
  data () {
    return {
      src:'/web/v1/statics/wav/store/W5611.wav',
      timer:null
    }
  },
  mounted () {
    this.getEasyRing();
  },
  computed: {
    locale () {
      // 只是为了切换语言时，更新标题
      const { title } = this.$route.meta
      const domTitle = this.$store.getters.admin_name
      if(title) {
        title && setDocumentTitle(`${i18nRender(title)} - ${domTitle}`)
      }else {
        setDocumentTitle(`${domTitle}`)
      }
      return this.$i18n.getLocaleMessage(this.$store.getters.lang).antLocale
    }
  },

  methods:{
    getEasyRing(){
      let audio = document.getElementById("myAudio");
      // this.timer = setTimeout(()=>{
      //   let AccessToken = storage.get('Access-Token'),
      //     isPlatform = storage.get('isPlatform');

      //     console.log('AccessToken,',AccessToken);
      //     console.log('AccessToken,',isPlatform);
      // },5000)
      console.log('audio,',audio);
    }
  }
}
</script>
<style lang="less">
/* 引入自定义样式 */
@import url('./assets/css/common.css');
.searchBox {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  /deep/ .ant-input-affix-wrapper {
    width: 220px;
    margin-right: 20px;
  }
  .select {
    margin-top: 11px;
    display: flex;
    align-items: center;
    margin-right: 15px;
    span {
      white-space: nowrap;
    }
  }
  .ant-btn {
    margin-top: 11px;
  }
}

#AUDIO{
  position: fixed;
  left: -100%;
  top: -100%;
}
</style>
